package com.bsoft.gol.hcs.specialist.bean.response;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author tongtp
 * @version v0.1
 * @package specialist.bean.response
 * @className FactorData
 * @description 因素数据
 * @create 2022-05-26 14:28
 **/
public class FactorData implements Serializable, Comparable<FactorData> {

	private static final long serialVersionUID = 4795867136349710797L;

	/*
	数据来源: 1 同步的诊疗数据数据库 2 表单答案数据库
	 */
	private String dataSource;
	/*
	子路径因素id
	 */
	private Long routeDetailFactorId;
	/*
	子路径因素排序号
	 */
	private Integer sort;
	/*
	因素条件选择 and 并且 or 或者
	 */
	private String factorConditionType;
	/*
	因素类别
	 */
	private Byte factorType;
	/*
	病人id
	 */
	private String patientId;
	//=============诊断数据start=============
	/*
	诊断记录标识
	 */
	private String diagnosticRecordId;
	/*
	业务诊断类型：1入院诊断、2出院诊断、3门诊诊断、5其他诊断
	 */
	private String diagnosisServiceType;
	/*
	疾病代码
	 */
	private String diseasesCode;
	/*
	疾病名称
	 */
	private String diseasesName;
	/*
	诊断时间
	 */
	private Date diagnosisTime;
	//=============诊断数据end=============

	//=============手术数据start=============
	/*
	手术记录标识
	 */
	private String operationRecordId;
	/*
	手术编码
	 */
	private String operationCode;
	/*
	手术名称
	 */
	private String operationName;
	/*
	手术结束时间
	 */
	private Date operationEndTime;
	//=============手术数据end=============

	//=============关联指标数据start=============
	/*
	关联指标记录的唯一id
	 */
	private String indexRecordId;
	/*
	关联指标编码
	 */
	private String indexCode;
	/*
	关联指标名称
	 */
	private String indexName;

	/*
	关联指标结果值
	 */
	private String indexResult;
	/*
	报告时间
	 */
	private Date reportTime;
	//=============关联指标数据end=============

	//=============医嘱数据start=============
	/*
	医嘱执行时间
	 */
	private Date executionTime;
	//=============医嘱数据end=============

	//=============专病分期数据start=============
	/*
	入组记录分期属性标识
	 */
	private Long stagesRecordId;
	/*
	分期编码
	 */
	private String stagesCode;
	/*
	分期名称
	 */
	private String stagesName;
	/*
	分期变更创建时间
	 */
	private Date stagesRecordCreateTime;
	//=============专病分期end=============

	//=============专病拓展属性数据start=============
	/*
	入组记录专病拓展属性标识
	 */
	private Long groupChronicRecordId;
	/*
	拓展属性
	 */
	private Long extendId;
	/*
	拓展属性分期名称
	 */
	private String name;
	/*
	分期拓展属性生效创建时间
	 */
	private Date extendTime;
	//=============专病分期end=============

	//=============门诊医生数据start=============
	/*
	就诊记录标识
	 */
	private String visitRecordId;
	/*
	机构代码
	 */
	private String organizationId;
	/*
	医生代码
	 */
	private String doctorId;
	/*
	医生名称
	 */
	private String doctorName;
	/*
	就诊时间
	 */
	private Date visitTime;
	//=============门诊医生数据end=============

	//=============住院责任医生数据start=============
	/*
	记录标识
	 */
	private String hospitalRecordId;
	/*
	机构代码，上面其他数据返回有这字段，这边只是注释一下
	 */
//	private String organizationId;
	/*
	医生代码
	 */
//	private String doctorId;
	/*
	医生名称
	 */
//	private String doctorName;
	/*
	就诊时间
	 */
	private Date dischargeTime;
	//=============门诊医生数据end=============

    //=============随访路径数据start=============
    private String  routeDetailId;

	public Date getExecutionTime() {
		return executionTime;
	}

	public void setExecutionTime(Date executionTime) {
		this.executionTime = executionTime;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public Date getReportTime() {
		return reportTime;
	}

	public void setReportTime(Date reportTime) {
		this.reportTime = reportTime;
	}

	public String getDataSource() {
		return dataSource;
	}

	public void setDataSource(String dataSource) {
		this.dataSource = dataSource;
	}

	public Long getRouteDetailFactorId() {
		return routeDetailFactorId;
	}

	public void setRouteDetailFactorId(Long routeDetailFactorId) {
		this.routeDetailFactorId = routeDetailFactorId;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getFactorConditionType() {
		return factorConditionType;
	}

	public void setFactorConditionType(String factorConditionType) {
		this.factorConditionType = factorConditionType;
	}

	public Byte getFactorType() {
		return factorType;
	}

	public void setFactorType(Byte factorType) {
		this.factorType = factorType;
	}

	public String getPatientId() {
		return patientId;
	}

	public void setPatientId(String patientId) {
		this.patientId = patientId;
	}

	public String getDiagnosticRecordId() {
		return diagnosticRecordId;
	}

	public void setDiagnosticRecordId(String diagnosticRecordId) {
		this.diagnosticRecordId = diagnosticRecordId;
	}

	public String getDiagnosisServiceType() {
		return diagnosisServiceType;
	}

	public void setDiagnosisServiceType(String diagnosisServiceType) {
		this.diagnosisServiceType = diagnosisServiceType;
	}

	public String getDiseasesCode() {
		return diseasesCode;
	}

	public void setDiseasesCode(String diseasesCode) {
		this.diseasesCode = diseasesCode;
	}

	public String getDiseasesName() {
		return diseasesName;
	}

	public void setDiseasesName(String diseasesName) {
		this.diseasesName = diseasesName;
	}

	public Date getDiagnosisTime() {
		return diagnosisTime;
	}

	public void setDiagnosisTime(Date diagnosisTime) {
		this.diagnosisTime = diagnosisTime;
	}

	public String getOperationRecordId() {
		return operationRecordId;
	}

	public void setOperationRecordId(String operationRecordId) {
		this.operationRecordId = operationRecordId;
	}

	public String getOperationCode() {
		return operationCode;
	}

	public void setOperationCode(String operationCode) {
		this.operationCode = operationCode;
	}

	public String getOperationName() {
		return operationName;
	}

	public void setOperationName(String operationName) {
		this.operationName = operationName;
	}

	public Date getOperationEndTime() {
		return operationEndTime;
	}

	public void setOperationEndTime(Date operationEndTime) {
		this.operationEndTime = operationEndTime;
	}

	public String getIndexRecordId() {
		return indexRecordId;
	}

	public void setIndexRecordId(String indexRecordId) {
		this.indexRecordId = indexRecordId;
	}

	public String getIndexCode() {
		return indexCode;
	}

	public void setIndexCode(String indexCode) {
		this.indexCode = indexCode;
	}

	public String getIndexName() {
		return indexName;
	}

	public void setIndexName(String indexName) {
		this.indexName = indexName;
	}

	public String getIndexResult() {
		return indexResult;
	}

	public void setIndexResult(String indexResult) {
		this.indexResult = indexResult;
	}

	public Long getStagesRecordId() {
		return stagesRecordId;
	}

	public void setStagesRecordId(Long stagesRecordId) {
		this.stagesRecordId = stagesRecordId;
	}

	public String getStagesCode() {
		return stagesCode;
	}

	public void setStagesCode(String stagesCode) {
		this.stagesCode = stagesCode;
	}

	public String getStagesName() {
		return stagesName;
	}

	public void setStagesName(String stagesName) {
		this.stagesName = stagesName;
	}

	public Date getStagesRecordCreateTime() {
		return stagesRecordCreateTime;
	}

	public void setStagesRecordCreateTime(Date stagesRecordCreateTime) {
		this.stagesRecordCreateTime = stagesRecordCreateTime;
	}

	public Long getGroupChronicRecordId() {
		return groupChronicRecordId;
	}

	public void setGroupChronicRecordId(Long groupChronicRecordId) {
		this.groupChronicRecordId = groupChronicRecordId;
	}

	public Long getExtendId() {
		return extendId;
	}

	public void setExtendId(Long extendId) {
		this.extendId = extendId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getExtendTime() {
		return extendTime;
	}

	public void setExtendTime(Date extendTime) {
		this.extendTime = extendTime;
	}

	public String getVisitRecordId() {
		return visitRecordId;
	}

	public void setVisitRecordId(String visitRecordId) {
		this.visitRecordId = visitRecordId;
	}

	public String getOrganizationId() {
		return organizationId;
	}

	public void setOrganizationId(String organizationId) {
		this.organizationId = organizationId;
	}

	public String getDoctorId() {
		return doctorId;
	}

	public void setDoctorId(String doctorId) {
		this.doctorId = doctorId;
	}

	public String getDoctorName() {
		return doctorName;
	}

	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}

	public Date getVisitTime() {
		return visitTime;
	}

	public void setVisitTime(Date visitTime) {
		this.visitTime = visitTime;
	}

	public String getHospitalRecordId() {
		return hospitalRecordId;
	}

	public void setHospitalRecordId(String hospitalRecordId) {
		this.hospitalRecordId = hospitalRecordId;
	}

	public Date getDischargeTime() {
		return dischargeTime;
	}

	public void setDischargeTime(Date dischargeTime) {
		this.dischargeTime = dischargeTime;
	}

    public String getRouteDetailId() {
        return routeDetailId;
    }

    public void setRouteDetailId(String routeDetailId) {
        this.routeDetailId = routeDetailId;
    }

    @Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (!(o instanceof FactorData)) return false;
		FactorData that = (FactorData) o;
		return
				Objects.equals(getPatientId(), that.getPatientId());
	}

	@Override
	public int hashCode() {
		return Objects.hash(getDataSource(), getRouteDetailFactorId(), getFactorConditionType(), getFactorType(),
				getPatientId(), getDiagnosticRecordId(), getDiagnosisServiceType(), getDiseasesCode(),
				getDiseasesName(), getDiagnosisTime(), getOperationRecordId(), getOperationCode(), getOperationName(),
				getOperationEndTime(), getIndexRecordId(), getIndexCode(), getIndexName(), getIndexResult(),
				getReportTime(), getExecutionTime(), getStagesRecordId(), getStagesCode(), getStagesName(),
				getStagesRecordCreateTime(), getGroupChronicRecordId(), getExtendId(), getName(), getExtendTime(),
				getVisitRecordId(), getOrganizationId(), getDoctorId(), getDoctorName(), getVisitTime(),
				getHospitalRecordId(), getDischargeTime());
	}

	/**
	 * 重现compareTo,实现排序，因为执行因素的时候,门诊就诊和住院状态的因素是会排在同组因素后面执行的，所以在算因素时间时要还原原有排序计算
	 */
	@Override
	public int compareTo(FactorData o) {
		//升序排列，最小的在前
		return this.sort - o.getSort();
	}
}
